package gonz.grabber;

import gonz.grabber.modernbag.ModernbagGrabber;
import gonz.grabber.modernbag.VKalbumGrabber;
import gonz.grabber.modernbag.VScollection;

import java.util.HashMap;
import java.util.Map;

public class GrabberFactory {

    private GrabberFactory() {
    }

    private static final Map<GrabberName, Grabber> GRABBERS = new HashMap<GrabberName, Grabber>() {
        {
            put(GrabberName.MODERNBAG, new ModernbagGrabber());
            put(GrabberName.VKALBUM, new VKalbumGrabber());
            put(GrabberName.VSCOLLECTION, new VScollection());
        }
    };

    public static Grabber getGrabber(GrabberName grabberName) {
        return GRABBERS.get(grabberName);
    }

    public static Grabber getGrabber(String grabberNameStr) {
        GrabberName grabberName = GrabberName.valueOf(grabberNameStr);
        return getGrabber(grabberName);
    }

}
